/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ubisalusanalysissimulator;

import Analyser.Analyser;
import jWASA.PHR;
import java.sql.Time;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import samples.ElaboratedSampleCollection;
import simulation.SamplesGenerator;
import simulation.SimulationPhantomPhobia;

/**
 *
 * @author gianmariospacagna
 */
public class UbiSalusAnalysisSimulator {

    private static Date date;

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        SimulationPhantomPhobia simulation = new SimulationPhantomPhobia();
        SamplesGenerator simulator = new SamplesGenerator();

        ElaboratedSampleCollection esc = new ElaboratedSampleCollection();
        Collection<PHR> PHRrecords = new ArrayList<PHR>();

        
       System.out.println("Starting samples generation");

        
        simulator.simulate(simulation, esc, PHRrecords);

        //simulator.print(simulation, esc, PHRrecords);
        long end = System.currentTimeMillis();
        System.out.println("Samples generation completed in " + (end - start) + " ms");
        
        System.out.println("Printing samples generated...");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException ex) {
            Logger.getLogger(UbiSalusAnalysisSimulator.class.getName()).log(Level.SEVERE, null, ex);
        }
        //simulator.print(simulation, esc, PHRrecords);
        
        System.out.println("Preparing data for analysis...");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException ex) {
            Logger.getLogger(UbiSalusAnalysisSimulator.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.out.println("Data analysis started");

        start = System.currentTimeMillis();
        Analyser analyser = new Analyser();
        analyser.analyseData(esc, PHRrecords);
        end = System.currentTimeMillis();
        System.out.println("Analysis completed in " + (end - start) + " ms");

    }
}
